# health_check.py
import os
import time

from sklearn.ensemble._hist_gradient_boosting import predictor

from alert import send_alert


def health_check():
    # 检查日志文件是否存在
    if not os.path.exists("/var/log/mysql/slow.log"):
        send_alert("🚨 DBGuardian: slow.log 文件不存在！")

    # 检查 AI 模型是否加载成功
    if not predictor.model:
        send_alert("🚨 DBGuardian: AI 模型未加载！")